import { defineStore } from 'pinia';
import { ref } from "vue"
import { inProgressStore } from "@/stores/inProgress.js"
const inProgress = inProgressStore()

export const useCommonStore = defineStore('common', () => {
	// 存储顶部导航栏下标
	const selectIndex = ref(1) //0:我的，1：对话；2：ai会话

	const setSelectIndex = (index) => {
		if (selectIndex.value === index) return
		if (inProgress.queryStatus()) return
		selectIndex.value = index
	}

	return { selectIndex, setSelectIndex }
});